import 'package:flutter/material.dart';
import 'package:flutter_with_bmap/consts/light_diretion.dart';
import 'package:flutter_with_bmap/mixins/sprite_bg.dart';

/// 信号灯相关得东西
class LightIcon extends StatefulWidget {
  final LightDiretion diretion;
  const LightIcon(this.diretion, {super.key});
  @override
  State<StatefulWidget> createState() => LightIconState();
}

class LightIconState extends State<LightIcon> with SpriteBg {
  //雪碧图里面每个图标的宽度数组
  @override
  String get assetName => "flutter_assets/images/lights.png";
  @override
  List<double> get itemWidthList => [42, 42, 42, 42, 42, 42, 42, 45, 42];
  @override
  double get iconHeight => 45;
  @override
  int get index => widget.diretion.index;
}
